﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Data.Linq;
using System.Data.OleDb;
using DataAccess;

public partial class ExpertManager_UploadTasks : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void ButtonUpload_Click(object sender, EventArgs e)
    {
        string fileName = FileUploadExcel.ResolveClientUrl(FileUploadExcel.PostedFile.FileName);
        int count = 0;

        DataTable dtExcel = new DataTable();
        string SourceConstr = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source='" + fileName + "';Extended Properties= 'Excel 8.0;HDR=Yes;IMEX=1'";
        OleDbConnection con = new OleDbConnection(SourceConstr);
        string query = "Select * from [Sheet1$]";
        OleDbDataAdapter data = new OleDbDataAdapter(query, con);
        data.Fill(dtExcel);
        string s = dtExcel.Rows[0]["Name"].ToString();
         
    }
}